<?php /*a:3:{s:65:"D:\phpstudy_pro\WWW\git\DSShop\app\admin\view\groupbuy\index.html";i:1591758938;s:64:"D:\phpstudy_pro\WWW\git\DSShop\app\admin\view\public\header.html";i:1571626691;s:69:"D:\phpstudy_pro\WWW\git\DSShop\app\admin\view\public\admin_items.html";i:1566788179;}*/ ?>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <title>DSShop单店铺商城系统后台</title>
        <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
        <link rel="stylesheet" href="<?php echo htmlentities(ADMIN_SITE_ROOT); ?>/css/admin.css">
        <link rel="stylesheet" href="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/js/jquery-ui/jquery-ui.min.css">
        <script src="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/jquery-2.1.4.min.js"></script>
        <script src="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/jquery.validate.min.js"></script>
        <script src="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/jquery.cookie.js"></script>
        <script src="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/common.js"></script>
        <script src="<?php echo htmlentities(ADMIN_SITE_ROOT); ?>/js/admin.js"></script>
        <script src="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/js/jquery-ui/jquery-ui.min.js"></script>
        <script src="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/js/jquery-ui/jquery.ui.datepicker-zh-CN.js"></script>
        <script src="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/perfect-scrollbar.min.js"></script>
        <script src="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/layer/layer.js"></script>
        <script src="<?php echo htmlentities(PLUGINS_SITE_ROOT); ?>/js/dialog/dialog.js" id="dialog_js" charset="utf-8"></script>

        <script type="text/javascript">
            var BASESITEROOT = "<?php echo htmlentities(BASE_SITE_ROOT); ?>";
            var ADMINSITEROOT = "<?php echo htmlentities(ADMIN_SITE_ROOT); ?>";
            var BASESITEURL = "<?php echo htmlentities(BASE_SITE_URL); ?>";
            var HOMESITEURL = "<?php echo htmlentities(HOME_SITE_URL); ?>";
            var ADMINSITEURL = "<?php echo htmlentities(ADMIN_SITE_URL); ?>";
        </script>
    </head>
    <body>
        <div id="append_parent"></div>
        <div id="ajaxwaitid"></div>








<div class="page">
    <div class="fixed-bar">
        <div class="item-title">
            <div class="subject">
                <h3>抢购管理</h3>
                <h5></h5>
            </div>
            <?php if($admin_item): ?>
<ul class="tab-base ds-row">
    <?php if(is_array($admin_item) || $admin_item instanceof \think\Collection || $admin_item instanceof \think\Paginator): if( count($admin_item)==0 ) : echo "" ;else: foreach($admin_item as $key=>$item): ?>
    <li><a href="<?php echo htmlentities($item['url']); ?>" <?php if($item['name'] == $curitem): ?>class="current"<?php endif; ?>><span><?php echo htmlentities($item['text']); ?></span></a></li>
    <?php endforeach; endif; else: echo "" ;endif; ?>
</ul>
<?php endif; ?>
        </div>
    </div>

    <form method="get" name="formSearch">
        <div class="ds-search-form">
            <dl>
                <dt>抢购名称</dt>
                <dd><input type="text" value="<?php echo htmlentities(app('request')->get('groupbuy_name')); ?>" name="groupbuy_name" id="groupbuy_name" class="txt" style="width:100px;"></dd>
            </dl>
            <dl>
                <dt>状态</dt>
                <dd><select name="groupbuy_state" class="w90">
                        <?php if(!(empty($groupbuy_state_array) || (($groupbuy_state_array instanceof \think\Collection || $groupbuy_state_array instanceof \think\Paginator ) && $groupbuy_state_array->isEmpty()))): if(is_array($groupbuy_state_array) || $groupbuy_state_array instanceof \think\Collection || $groupbuy_state_array instanceof \think\Paginator): if( count($groupbuy_state_array)==0 ) : echo "" ;else: foreach($groupbuy_state_array as $key=>$val): ?>
                        <option value="<?php echo htmlentities($key); ?>" {eq name="key" value="$Request.get.groupbuy_state" }selected{
                        /eq}>
                        <?php echo htmlentities($val); ?></option>
                        <?php endforeach; endif; else: echo "" ;endif; ?>
                        <?php endif; ?>
                    </select>
                </dd>
            </dl>
            <div class="btn_group">
                <a href="javascript:document.formSearch.submit();" class="btn" title="<?php echo htmlentities(lang('ds_query')); ?>"><?php echo htmlentities(lang('ds_query')); ?></a>
                <?php if($filtered): ?>
                <a href="<?php echo url('Groupbuy/index'); ?>" class="btn btn-default" title="<?php echo htmlentities(lang('ds_cancel')); ?>"><?php echo htmlentities(lang('ds_cancel')); ?></a>
                <?php endif; ?>
            </div>
        </div>
    </form>
    <!--  说明 -->

    <div class="explanation" id="explanation">
        <div class="title" id="checkZoom">
            <h4 title="<?php echo htmlentities(lang('ds_explanation_tip')); ?>"><?php echo htmlentities(lang('ds_explanation')); ?></h4>
            <span id="explanationZoom" title="<?php echo htmlentities(lang('ds_explanation_close')); ?>" class="arrow"></span>
        </div>
        <ul>
            <li>管理员可以审核新的抢购活动申请、取消进行中的抢购活动或者删除抢购活动</li>
        </ul>
    </div>


    <form id="list_form" method="post">
        <input type="hidden" id="group_id" name="group_id"/>
        <table class="ds-default-table">
            <thead>
            <tr class="thead">
                <th colspan="2"><?php echo htmlentities(lang('groupbuy_index_name')); ?></th>
                <th class="align-center" width="120"><?php echo htmlentities(lang('start_time')); ?></th>
                <th class="align-center" width="120"><?php echo htmlentities(lang('end_time')); ?></th>
                <th class="align-center" width="80"><?php echo htmlentities(lang('groupbuy_index_click')); ?></th>
                <th class="align-center" width="80">已购买</th>
                <th class="align-center" width="80"><?php echo htmlentities(lang('ds_recommend')); ?></th>
                <th class="align-center" width="120"><?php echo htmlentities(lang('groupbuy_index_state')); ?></th>
                <th class="align-center" width="150"><?php echo htmlentities(lang('ds_handle')); ?></th>
            </tr>
            </thead>
            <tbody id="treet1">
            <?php if(!(empty($groupbuy_list) || (($groupbuy_list instanceof \think\Collection || $groupbuy_list instanceof \think\Paginator ) && $groupbuy_list->isEmpty()))): if(is_array($groupbuy_list) || $groupbuy_list instanceof \think\Collection || $groupbuy_list instanceof \think\Paginator): if( count($groupbuy_list)==0 ) : echo "" ;else: foreach($groupbuy_list as $key=>$val): ?>
            <tr class="hover">
                <td class="w60 picture">
                    <div class="size-56x56"><span class="thumb size-56x56"><i></i>
                        <a target="_blank" href="<?php echo url('home/Showgroupbuy/groupbuy_detail',['group_id'=>$val['groupbuy_id']]); ?>"><img src="<?php echo groupbuy_thumb($val['groupbuy_image']); ?>" style=" max-width: 56px; max-height: 56px;"/></a></span></div>
                </td>
                <td class="group"><p>
                    <a target="_blank" href="<?php echo url('home/Showgroupbuy/groupbuy_detail',['group_id'=>$val['groupbuy_id']]); ?>"> <?php echo htmlentities($val['groupbuy_name']); ?></a>
                </p>
                    <p class="goods"><?php echo htmlentities(lang('ds_goods_name')); ?>:<a target="_blank" href="<?php echo url('home/Goods/index',['goods_id'=>$val['goods_id']]); ?>" title="<?php echo htmlentities($val['goods_name']); ?>" target="_blank"><?php echo htmlentities($val['goods_name']); ?></a></p>
                </td>
                <td class="align-center nowarp"><?php echo htmlentities($val['start_time_text']); ?></td>
                <td class="align-center nowarp"><?php echo htmlentities($val['end_time_text']); ?></td>
                <td class="align-center"><?php echo htmlentities($val['groupbuy_views']); ?></td>
                <td class="align-center"><?php echo htmlentities($val['groupbuy_buy_quantity']); ?></td>
                <td class="yes-onoff align-center">
                    <?php if($val['groupbuy_recommended'] == '0'): ?>
                    <a href="JavaScript:void(0);" class=" disabled" ajax_branch='recommended' ds_type="inline_edit" fieldname="recommended" fieldid="<?php echo htmlentities($val['groupbuy_id']); ?>" fieldvalue="0" title="<?php echo htmlentities(lang('ds_editable')); ?>">
                        <img src="<?php echo htmlentities(ADMIN_SITE_ROOT); ?>/images/treetable/transparent.gif">
                    </a>
                    <?php else: ?>
                    <a href="JavaScript:void(0);" class=" enabled" ajax_branch='recommended' ds_type="inline_edit" fieldname="recommended" fieldid="<?php echo htmlentities($val['groupbuy_id']); ?>" fieldvalue="1" title="<?php echo htmlentities(lang('ds_editable')); ?>">
                        <img src="<?php echo htmlentities(ADMIN_SITE_ROOT); ?>/images/treetable/transparent.gif">
                    </a>
                    <?php endif; ?>
                <td class="align-center"><?php echo htmlentities($val['groupbuy_state_text']); ?></td>
                <td class="align-center">
                    <?php if($val['reviewable']): ?>
                    <a dstype="btn_review_pass" data-groupbuy-id="<?php echo htmlentities($val['groupbuy_id']); ?>" href="javascript:;" class="dsui-btn-add"><i class="iconfont"></i>通过</a>
                    <a dstype="btn_review_fail" data-groupbuy-id="<?php echo htmlentities($val['groupbuy_id']); ?>" href="javascript:;" class="dsui-btn-del"><i class="iconfont"></i>拒绝</a>
                    <?php endif; if($val['cancelable']): ?>
                    <a href="javascript:dsLayerConfirm('<?php echo url('Groupbuy/groupbuy_cancel',['groupbuy_id'=>$val['groupbuy_id']]); ?>',' 确认取消该抢购活动？')" class="dsui-btn-del"><i class="iconfont"></i>取消</a>
                    <?php endif; ?>
                    <a href="javascript:dsLayerConfirm('<?php echo url('Groupbuy/groupbuy_del',['groupbuy_id'=>$val['groupbuy_id']]); ?>',' 确认删除该抢购活动？',<?php echo htmlentities($val['groupbuy_id']); ?>)" class="dsui-btn-del"><i class="iconfont"></i>删除</a>
                </td>
            </tr>
            <?php endforeach; endif; else: echo "" ;endif; else: ?>
            <tr class="no_data">
                <td colspan="16"><?php echo htmlentities(lang('ds_no_record')); ?></td>
            </tr>
            <?php endif; ?>
            </tbody>
        </table>
        <?php if(!(empty($groupbuy_list) || (($groupbuy_list instanceof \think\Collection || $groupbuy_list instanceof \think\Paginator ) && $groupbuy_list->isEmpty()))): ?>
        <?php echo $show_page; ?>
        <?php endif; ?>
    </form>

</div>
<form id="op_form" action="" method="POST">
    <input type="hidden" id="groupbuy_id" name="groupbuy_id">
</form>
<script type="text/javascript" src="<?php echo htmlentities(ADMIN_SITE_ROOT); ?>/js/jquery.edit.js" charset="utf-8"></script>
<script type="text/javascript">
    $(document).ready(function () {

        $('[dstype="btn_cancel"]').on('click', function () {
            layer.confirm('确认取消该抢购活动？', {
                btn: ['确定', '取消'],
                title: false,
            }, function () {
                    var action = "<?php echo url('Groupbuy/groupbuy_cancel'); ?>";
                    var groupbuy_id = $(this).attr('data-groupbuy-id');
                    $('#op_form').attr('action', action);
                    $('#groupbuy_id').val(groupbuy_id);
                    $('#op_form').submit();
            });
        });

        $('[dstype="btn_del"]').on('click', function () {
            layer.confirm('确认删除该抢购活动？', {
                btn: ['确定', '取消'],
                title: false,
            }, function () {
                var action = "<?php echo url('Groupbuy/groupbuy_del'); ?>";
                var groupbuy_id = $(this).attr('data-groupbuy-id');
                $('#op_form').attr('action', action);
                $('#groupbuy_id').val(groupbuy_id);
                $('#op_form').submit();
            });
        });
    });
</script>
